package com.thread;

/**
 * 饿汉式
 * 一上来就使用
 */
public class ThreadSingleClass006 {
    private  static ThreadSingleClass006 instance = new ThreadSingleClass006();

    private ThreadSingleClass006(){}

    public static ThreadSingleClass006 getInstance(){
        return instance;
    }

    public static void main(String[] args) {
        ThreadSingleClass006 m1 = ThreadSingleClass006.getInstance();
        ThreadSingleClass006 m2 = ThreadSingleClass006.getInstance();

        System.out.println(m1==m2);
    }
}
